package com.apps.realtyportal;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jason.apps.dashboard.LatestSold;
import com.jason.apps.dashboard.ShowChart;

public class MyFragmentPagerAdapterManageReports extends FragmentPagerAdapter {

	
	final int PAGE_COUNT = 2;

	/** Constructor of the class */
	public MyFragmentPagerAdapterManageReports(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	/** This method will be invoked when a page is requested to create */
	@Override
	public Fragment getItem(int arg0) {
		Bundle data = new Bundle();
		switch (arg0) {

		/** Android tab is selected */
		case 0:
			LatestSold addPropertyFragment = new LatestSold();
			data.putInt("current_page", arg0 + 1);
			addPropertyFragment.setArguments(data);
			return addPropertyFragment;

			/** Apple tab is selected */
		case 1:
			ShowChart editFragment = new ShowChart();
			data.putInt("current_page", arg0 + 1);
			editFragment.setArguments(data);
			return editFragment;

			
		}

		return null;
	}

	/** Returns the number of pages */
	@Override
	public int getCount() {
		return PAGE_COUNT;
	}

}
